//
//  HamatonCarViewModel.swift
//  hamaton-app
//
//  Created by intyt on 2024/4/7.
//

import Foundation

struct HamatonCarCellModel {
    let id: String
    let name: String
    let phoneNum: String
    let hamatonModel: HamatonModel
    let gender: String
    let management: String
}

struct HamatonModel {
    let id: String
    let name: String
}


class HamatonCarAddViewModel {

    public var name: String = ""
    public var phoneNum: String = ""
    public var gender: Int = 0
    public var hamatonModel: HamatonModel? = nil
    public var management: String = ""
    
     public func jundgeIsSave() -> String? {
         if self.name.count <= 0  {
             return "请输入人员名称"
         }
         
         if self.phoneNum.count <= 0  {
             return "请输入电话"
         }
         if hamatonModel == nil {
             return "请选择所属网格"
         }
         
         if self.management.count <= 0 {
             return "请选择职位"
         }
         
        return nil
    }
}
